<?php

namespace Gds\VenteBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Gds\VenteBundle\Entity\Caisse
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Gds\VenteBundle\Entity\CaisseRepository")
 */
class Caisse
{
     /**
     * @ORM\OneToMany(targetEntity="Gds\VenteBundle\Entity\SessionCaisse", mappedBy="caisse")
     */
    private $sessions; // Ici commentaires prend un "s", car un article a plusieurs commentaires !
   /**
     * @ORM\ManyToOne(targetEntity="Gds\ArticleBundle\Entity\Departement", inversedBy="caisses")
     */
    private $departement; // Ici commentaires prend un "s", car un article a plusieurs commentaires !
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $libelle
     *
     * @ORM\Column(name="libelle", type="string", length=255)
     */
    private $libelle;
    /**
     * @var string $code
     *
     * @ORM\Column(name="code", type="string", length=255)
     */
    private $code;
    /**
     * @var boolean $is_active
     *
     * @ORM\Column(name="is_active", type="boolean")
     */
    private $is_active;
    /**
     * @var boolean $is_supprimer
     *
     * @ORM\Column(name="is_supprimer", type="boolean")
     */
    private $is_supprimer;
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set libelle
     *
     * @param string $libelle
     * @return Caisse
     */
    public function setLibelle($libelle)
    {
        $this->libelle = $libelle;
    
        return $this;
    }

    /**
     * Get libelle
     *
     * @return string 
     */
    public function getLibelle()
    {
        return $this->libelle;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->sessions = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add sessions
     *
     * @param Gds\VenteBundle\Entity\SessionCaisse $sessions
     * @return Caisse
     */
    public function addSession(\Gds\VenteBundle\Entity\SessionCaisse $sessions)
    {
        $this->sessions[] = $sessions;
    
        return $this;
    }

    /**
     * Remove sessions
     *
     * @param Gds\VenteBundle\Entity\SessionCaisse $sessions
     */
    public function removeSession(\Gds\VenteBundle\Entity\SessionCaisse $sessions)
    {
        $this->sessions->removeElement($sessions);
    }

    /**
     * Get sessions
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getSessions()
    {
        return $this->sessions;
    }

    /**
     * Set departement
     *
     * @param \Gds\ArticleBundle\Entity\Departement $departement
     * @return Caisse
     */
    public function setDepartement(\Gds\ArticleBundle\Entity\Departement $departement = null)
    {
        $this->departement = $departement;

        return $this;
    }

    /**
     * Get departement
     *
     * @return \Gds\ArticleBundle\Entity\Departement 
     */
    public function getDepartement()
    {
        return $this->departement;
    }

    /**
     * Set is_active
     *
     * @param boolean $isActive
     * @return Caisse
     */
    public function setIsActive($isActive)
    {
        $this->is_active = $isActive;

        return $this;
    }

    /**
     * Get is_active
     *
     * @return boolean 
     */
    public function getIsActive()
    {
        return $this->is_active;
    }

    /**
     * Set is_supprimer
     *
     * @param boolean $isSupprimer
     * @return Caisse
     */
    public function setIsSupprimer($isSupprimer)
    {
        $this->is_supprimer = $isSupprimer;

        return $this;
    }

    /**
     * Get is_supprimer
     *
     * @return boolean 
     */
    public function getIsSupprimer()
    {
        return $this->is_supprimer;
    }

    /**
     * Set code
     *
     * @param string $code
     * @return Caisse
     */
    public function setCode($code)
    {
        $this->code = $code;

        return $this;
    }

    /**
     * Get code
     *
     * @return string 
     */
    public function getCode()
    {
        return $this->code;
    }
    public function __toString() {
        return $this->code.' |'.$this->libelle;;
    }
}
